<template>
  <view @click="handleClick">
    <!-- 插槽 被image标签替换 -->
    <slot></slot>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    handleClick() {
      // console.log("debug");
      // 1、将数据缓存下拉(全局缓存)
      getApp().globalData.imageList = this.list;
      getApp().globalData.imageIndex = this.index;
      // 2、点击跳转页面
      uni.navigateTo({
           url: '/pages/imageDetail/index',
      });
    },
  },
  /* 接收父组件传递过来的数据 */
  props: {
    list: Array,
    index: Number,
  },
  /* 组件生命周期函数，监听组件的挂载 */
  mounted() {
    // console.log(this.list);
    // console.log(this.index);
  },
};
</script>

<style lang="scss">
</style>